<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/25
 * Time: 18:23
 */
$http = new swoole_http_server('0.0.0.0', 8866);

$http->on('request', function ($request, $reponse){
    $cc = $request->get['cc'];

    $redis = new Swoole\Coroutine\Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->auth('123456');
    //$redis->set('zs', 'zhangsan');
    $zs = $redis->get($cc);

    $reponse->end($zs);
});

$http->start();